package com.wind.taobao.api.trade.item.rest
{
	import com.wind.taobao.api.IPublicAPI;
	import com.wind.taobao.core.exception.InvalidRequestParametersException;
	import com.wind.taobao.core.util.TaobaoUtils;
	import com.wind.taobao.core.webservice.TaobaoRequest;

	/**
	 *
	 * taobao.item.get  Request
	 * @author fxy
	 *
	 */
	public class ItemGetRequest extends TaobaoRequest
	{
		public override function get method():String
		{
			return "taobao.item.get"
		}
		/**
		 * Y 	 需要返回的商品对象字段。可选值：Item商品结构体中所有字段均可返回；多个字段用“,”分隔。如果想返回整个子对象，那字段为itemimg，如果是想返回子对象里面的字段，那字段为itemimg.url
		 */
		[Bindable]
		public var fields:String="iid,title,nick,type,cid,seller_cids,props,desc,pic_path,num,valid_thru,list_time,delist_time,stuff_status,location,price,post_fee,express_fee,ems_fee,has_discount,freight_payer,has_invoice,has_warranty,has_showcase,bulk_base_num,modified,increment,auto_repost,approve_status,propImgs,itemImgs,sku,video";
		/**
		 * Y  卖家昵称
		 */
		[Bindable]
		public var nick:String;
		/**
		 * 商品id
		 */
		[Bindable]
		public var iid:String;
		/**
		 * 商品数字id
		 */
		[Bindable]
		public var num_iid:String;

		public override function validate():void
		{
			if (!TaobaoUtils.hasValue(fields))
			{
				throw new InvalidRequestParametersException("请求参数[fields]不能为空");
			}
			if (!TaobaoUtils.hasValue(nick))
			{
				throw new InvalidRequestParametersException("请求参数[nick]不能为空");
			}
			if (!TaobaoUtils.hasAnyValue([iid, num_iid]))
			{
				throw new InvalidRequestParametersException("请求参数[iid, num_iid]至少有一个有值");
			}
		}

	}
}